

def inf():
    i = 3
    while True:
        yield i
        i += 2

def prime(c):
    primes = []
    for i in inf():
        is_prime = True
        for p in primes:
            if p * p > i:
                break
            if i % p == 0:
                is_prime = False
                break
        if is_prime:
            if len(primes) == c - 2:
                return i
            else:
                primes.append(i)

print prime(10001)